# Maintainer: David Runge <dvzrv@archlinux.org>

pkgname=lv2lint
pkgver=0.16.2
pkgrel=2
pkgdesc="Check whether a given LV2 plugin is up to the specification"
arch=(loong64 x86_64)
url="https://git.open-music-kontrollers.ch/~hp/lv2lint"
license=(Artistic2.0)
depends=(
  glibc
  libelf
)
makedepends=(
  curl
  lilv
  lv2
  meson
)
source=(
  $pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz
  $pkgname-$pkgver.tar.gz.asc::$url/archive/$pkgver.tar.gz.asc
)
sha512sums=('8abd393832179f526d15b141a88239af355cdcccd9284e44c3deea2e4d189959242311993d6ef04aea5634d02e01f659cd4141092668cf9b7e13c1d136923ce8'
            'SKIP')
b2sums=('db221cb2e5e7a25c1a962ae7b1376adce24d593ca871b444fe3bd1a333aedfddcb02bafd5a3dbf4cf1da015b54dc7ca59e3e37208c1902390c524c6b005a83bc'
        'SKIP')
validpgpkeys=('5AE26CEBBF49705C19FB273A30258F99258CB76A') # Hanspeter Portner <dev@open-music-kontrollers.ch>

build() {
  arch-meson -Donline-tests=enabled -Delf-tests=enabled build $pkgname-$pkgver
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  depends+=(
    curl libcurl.so
    lilv liblilv-0.so
  )

  meson install -C build --destdir "$pkgdir"
  install -vDm 644 $pkgname-$pkgver/{ChangeLog,README.md,TODO} -t "$pkgdir/usr/share/doc/$pkgname/"
}
